<%@page import="java.util.ArrayList"%>
<%@page import="com.jlrdb.model.CellularBroadcast"%>
<%@page import="com.jlrdb.model.CellularBroadcasts"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="/css/report.css">
<title>View Cellular Broadcasts</title>
</head>
<body>
	<%
		CellularBroadcasts cellularBroadcasts = (CellularBroadcasts) request.getAttribute("cellularBroadcasts");
		HttpSession session1 = request.getSession();
		String role = (String) session1.getAttribute("Role");
	%>
	<h3>
		Geographic Region: <font color="blue"><%=cellularBroadcasts.getCellularBroadcasts().get(0).getGeographic_Region()%></font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Country: <font color="blue"><%=cellularBroadcasts.getCellularBroadcasts().get(0).getCountry()%></font>
	</h3>
	<%
		if (role.equalsIgnoreCase("Admin"))
		{
	%>
	<p>
		<font color="red">click on UPDATE DETAILS to update data.</font>
	</p>
	<%
		}
	%>
	<%
		for (CellularBroadcast cellularBroadcast : cellularBroadcasts.getCellularBroadcasts())
		{
	%>
	<div id="content">
		<%
			if (role.equalsIgnoreCase("Admin"))
				{
		%>
		<p align="center">
			<a href="/CellularBroadcastServlet?action=getThisBroadcast&&broadcastId=<%=cellularBroadcast.getBroadcast_Id()%>">UPDATE DETAILS</a>
		</p>
		<%
			}
		%>
		<br>
		<table style="width: 80%;">
			<tr>
				<th>Cellular Technology:</th>
				<td><%=cellularBroadcast.getCellular_Technology()%></td>
			</tr>
			<tr>
				<th>Data Enhancement Technology:</th>
				<td><%=cellularBroadcast.getData_Enhancement_Technology()%></td>
			</tr>
			<tr>
				<th>Information Transfer Rate:</th>
				<td><%=cellularBroadcast.getInformation_Transfer_Rate()%></td>
			</tr>
			<tr>
				<th>Start Date:</th>
				<td><%=cellularBroadcast.getStart_Date()%></td>
			</tr>
			<tr>
				<th>End Date:</th>
				<td><%=cellularBroadcast.getEnd_Date()%></td>
			</tr>
			<tr>
				<th>Frequency Spectrum MHz:</th>
				<td><%=cellularBroadcast.getFrequency_Spectrum()%></td>
			</tr>
			<tr>
				<th>Market Penetration:</th>
				<td><%=cellularBroadcast.getMarket_Penetration()%></td>
			</tr>
			<tr>
				<th>Operators:</th>
				<td><%=cellularBroadcast.getOperators()%></td>
			</tr>
			<tr>
				<th>Source of reference:</th>
				<td>
					<%
						String full = cellularBroadcast.getSource_Of_Reference();
							String parts[] = full.split("[\\r\\n]+");
							for (String s : parts)
							{
								if (s.contains("http"))
								{
					%>
					<p>
						<a href="<%=s%>" target="_blank"><%=s%></a>
					</p> <%
 	} else
 			{
 %>
					<p><%=s%></p> <%
 	}
 		}
 %>
				</td>
			</tr>
			<tr>
				<th>Additional Contacts:</th>
				<td><%=cellularBroadcast.getAditional_Contacts()%></td>
			</tr>
			<tr>
				<th>Industry Regulators:</th>
				<td><%=cellularBroadcast.getIndustry_Regulators()%></td>
			</tr>
			<tr>
				<th>Market Confirmation:</th>
				<td><%=cellularBroadcast.getMarket_Confirmation()%></td>
			</tr>
			<tr>
				<th>Notes/Remarks/Forecast:</th>
				<td><%=cellularBroadcast.getNotes()%></td>
			</tr>
			<tr>
				<th>Drawbacks and Plan to overcome:</th>
				<td><%=cellularBroadcast.getProblems()%></td>
			</tr>
		</table>
	</div>
	<br>
	<%
		}
	%>
</body>
</html>